package com.itheima;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.HashMap;
import java.util.TreeMap;
import java.util.Comparator;

/**
 * @ProjectName: ybxy6
 * @Titile: Student
 * @Author: Chilemey
 * @Description: TODO
 */
@Data
@AllArgsConstructor

public class Student implements Comparable<Student>{
    private String name;
    private int age;

    @Override
    public int compareTo(Student o) {
        //按照学生年龄的正序排序
        return this.age - o.getAge();
    }
}